<?php
class ArchiveController extends DefaultController{
	public function _default(){
		$id = request('id');
		if (!$id){
			$this->_404();
		}
		$archive = ArchiveModel::get($id);
		
		if (!$archive){
			$this->_404();
		}
		
		if ($archive['url']){
			Header("HTTP/1.1 303 See Other"); 
			Header("Location: {$archive['url']}"); 
			exit;
		}
		
		$archive = $this->_formatArchive($archive);
		$this->assign('archive', $archive);
		$this->display();
	}
}